﻿#pragma once

#include <QString>
#include <QByteArray>
#include <QSerialPort>
#include <QMatrix4x4>

enum ProcessWay
{
	Average = 0
};

struct PortInfomation
{
	QString portName;
	QSerialPort::BaudRate baudRate;
	QSerialPort::DataBits dataBits;
	QSerialPort::Parity parity;
	QSerialPort::StopBits stopBits;
	QSerialPort::FlowControl flowCtr = QSerialPort::NoFlowControl;
	//QByteArray message;
};

struct InputParams
{
	//采样频率
	double sampleFrequency;
	//位长
	double sampleInterval;
	//阻抗
	double impedance;
	//输入幅度
	double inputAmplitude;
};

struct ConfigParams
{
	//xml配置文件路径
	QString configFilePath;
	//电路放大器增益值
	float expandValue;
	//采样幅数
	int imgAccount;
	//数据处理方式
	int processWay;
	//行扫描频率
	float rowFrequency;
	//场频率
	float colFrequency;

};

struct MyGLTransformParam
{
	double xRot = 0;
	double yRot = 0;
	double xTrans = 0;
	double yTrans = 0;
	double zoomCoe = -3;
	QMatrix4x4 modelMatrix;
	QMatrix4x4 viewMatrix;
	QMatrix4x4 projMatrix;
};

typedef struct PortInfomation PortInfomation;

typedef struct InputParams InputParams;

typedef struct ConfigParams ConfigParams;

typedef struct MyGLTransformParam MyGLTransParam;
//通讯协议


//Roaming Key
const QString ROAMING_KEY_LASTPATH = "lastPath";


#include <AsGlobalDataPool>
#include <AsConfig>

#define PtrConfig As::getConfig()->getConfigData<ConfigData>()
#define PtrCoreData As::getGlobalData<CoreData>(AsDefine::AsProcessCoreRole)
